<template>
  <div  style="text-align:left" >
    list窗口的基础组件类，处理列头拖动排序、导出数据的列头数据，以及列表显示个性化配置。
  </div>
</template>
<script>
import BaseUI from './baseUI'
export default {
  extends: BaseUI,
  name: 'MainUI',
  data() {
    return {
      tableId: '0',       // 处理的主表id, 在子类中覆写

      version: 0,   // 版本号,子列中覆盖值
      curentRow: {},
      isConditionPanel: false,     // 搜素框是否查询条件面板
      isMoreQueryTag: false,     // 搜素框是否更多查询标签
      queryEditObject: null, // 当前点击的查询标签对象
      moreParm: {   // 更多条件值
          groupOne: [
            {logic: 'AND', column: null, queryType: '', value: null, operations: []},
            {logic: 'AND', column: null, queryType: '', value: null, operations: []},
            {logic: 'AND', column: null, queryType: '', value: null, operations: []}
          ],
          groupTwo: [
            {logic: 'AND', column: null, queryType: '', value: null, operations: []},
            {logic: 'AND', column: null, queryType: '', value: null, operations: []},
            {logic: 'AND', column: null, queryType: '', value: null, operations: []}
          ],
          groupLogic: 'OR'
      }
    }
  },
  methods: {
    // 相应显示历史记录按钮
    onShowHistory(scope) {
      this.curentRow = {id: scope.row.id, name: scope.row.name}
    },

    // 查询标签联动查询面板
    onQueryTagPanel(val, type) {
      if (type === 'delEditObject') {
        this.queryEditObject = null
        return
      }
      this.isConditionPanel = type === 'edit'
      this.queryEditObject = val
      this.isMoreQueryTag = !this.isMoreQueryTag
    },

    // 查询标签点击事件
    onQueryTagClick(val) {
      this.queryEditObject = val
      this.moreParm = JSON.parse(val.conditions)
      this.isConditionPanel = true
    },
    // 查询面板显示
    onConditionPanel(type) {
      if (type === 'query') {
        this.queryEditObject = null
      }
      // 查询面板和查询表单切换时清空
      if (this.isConditionPanel) {
        this.$refs.conditionPanel.reset()
      } else {
        this.$refs.queryForm.resetFields()
      }
      this.isConditionPanel = !this.isConditionPanel
    }
  },
  mounted() {
   //  this.initTableColumns = JSON.parse(JSON.stringify(this.tableColumns))
  }
}
</script>

<style lang="scss">
	/* 隐藏除第一列之外的其他列的小三角图标 */
	.vxe-table--render-default .vxe-tree--btn-wrapper {
		 display: none;
	 }
	.vxe-table--render-default .vxe-body--column:not(:first-child) .vxe-tree-cell,
	.vxe-table--render-default .vxe-body--column:not(:first-child) .vxe-cell--tree-node,
	.vxe-table--render-default .vxe-table--fixed-right-wrapper .vxe-tree-cell,
	.vxe-table--render-default .vxe-table--fixed-right-wrapper .vxe-cell--tree-node {
		padding-left: 0!important;
	}
	.vxe-table--render-default .vxe-body--column:first-child .vxe-tree--btn-wrapper {
		display: inline-block;
	}
	.vxe-table--render-default .vxe-table--fixed-right-wrapper .vxe-tree--btn-wrapper {
		display: none!important;
	}
</style>
